****** Appendix: Table A5
****** Average leader transfer by round for each treatment group
clear all
version 17.0
cd 
import delimited "data\cleaned\uganda_jun17_cleaned.csv", bindquote(strict) varnames(1) clear

gen treat = treatment_pooled
* Subsetting to roles, treatments, rounds, etc of interest
keep if role == "C" & round != 1 & inlist(treat, "Strong Hidden VAT", "Weak Hidden VAT", "Direct Tax", "Windfall") & !inlist(leader_id, "c", "s")
replace treat = "Hidden VAT" if treatment == "Strong Hidden VAT"
replace treat = "Visible VAT" if treatment == "Weak Hidden VAT"


keep date_exp leader_transfer session_exp round leader_id treat sbj_thresh
rename treat treatment
destring leader_transfer, replace


encode treatment, gen(treat)
encode leader_id, gen(leader)
destring sbj_thresh, replace

reg leader_transfer i.treat, robust cluster(leader)
est store reg1
reg leader_transfer i.treat i.leader, robust cluster(leader)
est store reg2
reg leader_transfer i.treat i.leader i.round, robust cluster(leader)
est store reg3
reg leader_transfer sbj_thresh i.treat i.leader i.round, robust cluster(leader)
est store reg4

estout reg1 reg2 reg3 reg4 using "results/apptableA6.tex", cells(b(fmt(3) star) se(par)) starlevels(* 0.1 ** 0.05 *** 0.01) drop(*.leader *.round 1.treat) style(tex) replace
